﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DVDFilmoteka.Forms
{
    public partial class FindAllReportForm : Form
    {
        private readonly List<FindAllReport> report;

        public FindAllReportForm(List<FindAllReport> report)
        {
            InitializeComponent();

            this.report = report;
        }

        private void FindAllReportForm_Load(object sender, EventArgs e)
        {
            Int32 succesCount = 0;
            foreach (FindAllReport item in report)
            {
                object[] row = new object[5];
                row[0] = item.Succesfull;
                row[1] = item.OldCzechName;
                row[2] = item.OldOriginalName;
                row[3] = item.NewCzechName;
                row[4] = item.NewOriginalName;

                dataGridViewReport.Rows.Add(row);

                if (item.Succesfull) succesCount++;
            }

            labelSumary.Text = "Bylo hledáno " + report.Count + " titulů, z toho " + succesCount + " úspěšně nalezeno";
        }
    }
}
